package com.ycb.bookserver.mapper;


import com.book.enumeration.OperationType;
import com.ycb.book.entity.User;
import com.ycb.bookserver.annotation.AutoFill;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface WechatMapper {

    /**
     * 根据用户名查询用户
     * @param openid
     * @return
     */
    @Select("select * from user where openid = #{openid}")
    User getByOpenid(String openid);

    /**
     * 插入数据
     * @param user
     */
    @AutoFill(value = OperationType.INSERT)
    void insert(User user);


}
